package com.xmy.erp.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 需要回滚的sql
 * </p>
 *
 * @author hpiggy
 * @since 2023-09-09
 */
@TableName("back_data")
@ApiModel(value = "BackData对象", description = "需要回滚的sql")
public class BackData implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("与要回滚的实体id相同")
    private Long id;

    @ApiModelProperty("来源id(要回滚的实体id相同)")
    private Long sourceId;

    @ApiModelProperty("需要回滚的sql")
    private String backSql;

    @ApiModelProperty("回滚的类型")
    private Integer type;

    @ApiModelProperty("表名")
    private String tbName;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("0未回滚，1已回滚")
    private Integer status;

    @ApiModelProperty("回滚类型：比如：0删除作废都回滚,1删除回滚，2作废回滚")
    private Integer backType;

    @ApiModelProperty("如：insert,update,delete,select")
    private String sqlType;

    private LocalDateTime createdAt;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getSourceId() {
        return sourceId;
    }

    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }
    public String getBackSql() {
        return backSql;
    }

    public void setBackSql(String backSql) {
        this.backSql = backSql;
    }
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
    public String getTbName() {
        return tbName;
    }

    public void setTbName(String tbName) {
        this.tbName = tbName;
    }
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    public Integer getBackType() {
        return backType;
    }

    public void setBackType(Integer backType) {
        this.backType = backType;
    }
    public String getSqlType() {
        return sqlType;
    }

    public void setSqlType(String sqlType) {
        this.sqlType = sqlType;
    }
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public String toString() {
        return "BackData{" +
            "id=" + id +
            ", sourceId=" + sourceId +
            ", backSql=" + backSql +
            ", type=" + type +
            ", tbName=" + tbName +
            ", remark=" + remark +
            ", status=" + status +
            ", backType=" + backType +
            ", sqlType=" + sqlType +
            ", createdAt=" + createdAt +
        "}";
    }
}
